<?php
/**
 * Created by littleU.
 * User: littleU
 * Date: 2021-01-29
 * Time: 10:48
 */

namespace app\common\controller;


use think\Controller;
use think\Lang;

/**
 *公用的控制器，pc、app、微信各端不需要控制权限的控制器，必须继承该控制器
 * Class Common
 * @package app\common\controller
 */

class Common extends Controller
{
    public function _initialize()
    {
        $now_lang = $this->getSetLang();
        $this->assign('set_lang', $now_lang);
    }

    public function getSetLang()
    {
        $lang = Lang::detect();
        if($lang == 'zh-cn') {
            return 'en-us';
        }
        return 'zh-cn';
    }
}